package o;

import android.content.Context;
import android.content.Intent;
import com.huawei.appgallery.appcomment.impl.bean.ApproveCommentResBean;
import com.huawei.appgallery.appcomment.impl.bean.GetCommentResBean.AppCommentInfo;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import java.lang.ref.WeakReference;
import o.bcg.h;
import o.bdm.e;

public class bdn implements IServerCallBack {
    private String ˊ;
    private WeakReference<Context> ˋ;
    private String ˎ;
    private int ˏ;
    private int ॱ;

    public bdn(AppCommentInfo appCommentInfo, Context context, int i) {
        this.ॱ = appCommentInfo.ʼॱ();
        this.ˎ = appCommentInfo.ʽ();
        this.ˊ = appCommentInfo.ॱ();
        this.ˏ = i;
        this.ˋ = new WeakReference(context);
    }

    public bdn(String str, String str2, Context context, int i) {
        this.ˎ = str;
        this.ˊ = str2;
        this.ˏ = i;
        this.ˋ = new WeakReference(context);
    }

    public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
    }

    public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
        try {
            Context context = (Context) this.ˋ.get();
            if (context != null) {
                Object eVar = new e();
                if ((responseBean instanceof ApproveCommentResBean) && responseBean.getResponseCode() == 0) {
                    ˏ(context, ((ApproveCommentResBean) responseBean).getRtnCode_(), eVar);
                } else {
                    ckv.ˎ(context.getString(h.ˎ), 0);
                    eVar.ˏ(0);
                }
                eVar.ॱ(this.ॱ);
                eVar.ˎ(this.ˎ);
                eVar.ˋ(this.ˊ);
                Intent intent = new Intent("com.huawei.appmarket.service.broadcast.Approved");
                intent.putExtra("ACTION_PARAM_COMMENT_APPROVED", eVar);
                ll.ˏ(context).ˋ(intent);
            }
        } catch (Exception e) {
            bcb.ˋ.ˊ("ApproveStoreCallBack", "notifyResult(RequestBean req, ResponseBean response) " + e.toString());
        }
    }

    private void ˏ(Context context, int i, e eVar) {
        switch (i) {
            case 0:
                if (this.ˏ == 0) {
                    ˋ(eVar, 1, true);
                    return;
                } else {
                    ˋ(eVar, -1, false);
                    return;
                }
            case 1:
                ckv.ˎ(context.getString(h.ॱ), 0);
                eVar.ˏ(1);
                return;
            case 2:
                ckv.ˎ(context.getString(h.ˊ), 0);
                eVar.ˏ(0);
                return;
            case 8:
                ckv.ˎ(context.getString(h.ʻ), 0);
                eVar.ˏ(0);
                return;
            case 9:
                ckv.ˎ(context.getString(h.ॱˊ), 0);
                eVar.ˏ(0);
                return;
            case 10:
                ˋ(eVar, 1, true);
                eVar.ˊ(-1);
                eVar.ᐝ(0);
                return;
            case 11:
                ckv.ˎ(context.getString(h.ʼ), 0);
                eVar.ˏ(0);
                return;
            case 12:
                ckv.ˎ(context.getString(h.ʽ), 0);
                eVar.ˏ(0);
                return;
            default:
                ckv.ˎ(context.getString(h.ˎ), 0);
                eVar.ˏ(0);
                return;
        }
    }

    private void ˋ(e eVar, int i, boolean z) {
        int i2 = 1;
        eVar.ˎ(i);
        if (!z) {
            i2 = 0;
        }
        eVar.ˏ(i2);
    }
}
